﻿' LibWowArmory
' by Ronald M. Clifford (roncli@roncli.com)
'
' This source code is released under the GNU Library General Public License (LGPL) Version 2.1.

Namespace roncliProductions.LibWowArmory

    ''' <summary>
    ''' A class that encapsulates a single statistic
    ''' </summary>
    ''' <remarks></remarks>
    Public Class Statistic

        Private intID As Integer
        Private strHighest As String
        Private strName As String
        Private lngQuantity As Long

        ''' <summary>
        ''' The identification number of the statistic
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ID() As Integer
            Get
                Return intID
            End Get
            Set(ByVal value As Integer)
                intID = value
            End Set
        End Property

        ''' <summary>
        ''' For statistics that deal with the most type of item that was used/killed/etc., this is the item that was used/killed/etc. the most
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Highest() As String
            Get
                Return strHighest
            End Get
            Set(ByVal value As String)
                strHighest = value
            End Set
        End Property

        ''' <summary>
        ''' The statistic's name
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Name() As String
            Get
                Return strName
            End Get
            Set(ByVal value As String)
                strName = value
            End Set
        End Property

        ''' <summary>
        ''' The quantity of the statistic
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Quantity() As Long
            Get
                Return lngQuantity
            End Get
            Set(ByVal value As Long)
                lngQuantity = value
            End Set
        End Property

        ''' <summary>
        ''' A constructor that creates new statistic information
        ''' </summary>
        ''' <param name="intID"></param>
        ''' <param name="strName"></param>
        ''' <param name="strQuantity"></param>
        ''' <remarks></remarks>
        Public Sub New(ByVal intID As Integer, ByVal strName As String, ByVal strQuantity As String)
            Me.intID = intID
            Me.strName = strName
            If Not Long.TryParse(strQuantity, Me.lngQuantity) Then
                Me.lngQuantity = 0
            End If
        End Sub

        ''' <summary>
        ''' A constructor that creates new statistic information
        ''' </summary>
        ''' <param name="intID"></param>
        ''' <param name="strHighest"></param>
        ''' <param name="strName"></param>
        ''' <param name="strQuantity"></param>
        ''' <remarks></remarks>
        Public Sub New(ByVal intID As Integer, ByVal strHighest As String, ByVal strName As String, ByVal strQuantity As String)
            Me.intID = intID
            Me.strHighest = strHighest
            Me.strName = strName
            If Not Long.TryParse(strQuantity, Me.lngQuantity) Then
                Me.lngQuantity = 0
            End If
        End Sub

    End Class

End Namespace